/**
 * ClassName: class_250829
 * Package: PACKAGE_NAME
 * Description:
 *
 * @Author harkjeans
 * @Create 2025/8/29 15:57
 * @Version 1.0
 */
public class class_250829 {
    public static void main(String[] args) {
        //声明数组
        double[] prices;
        //数组初始化
        prices = new double[]{20.32, 43.21, 43.22};
        //声明和初始化
        String[] foods = new String[4];

        //数组元素的调用
        System.out.println(prices[0]);
        System.out.println(prices[2]);
        foods[0] = "龙虾";
        foods[1] = "螃蟹";
        System.out.println(foods[0]);

        //数组长度
        System.out.println(foods.length);

        //遍历数组
        for(int i = 0; i < 3; i++){
            System.out.println(prices[i]);
        }
        for (int i = 0; i < foods.length; i++) {
            System.out.println(foods[i]);
        }

    }
}

